define(["jquery","layuiall","jqform","helper"],function ($,layui,jqform,helper) {
    $(".js-ajax-dialog-btn").click(function (evt) {
        var href = $(this).attr("href");
        layer.confirm($(this).attr("data-msg"), {icon: 3, title:'温馨提示'}, function(index){
            var laod = layer.load(3,{
                success:function () {
                    $.ajax({
                        url:href,
                        dataType:'json',
                        data:{},
                        type:'get',
                        success:function (res) {
                            layer.msg(res.msg,{
                                end:function () {
                                    layer.close(laod)
                                    location.href = '';
                                }
                            })
                        }
                    });
                }
            });
            layer.close(index);
        });
        return false;
    })
    return  {
        setting:function () {
            jqform.init()
        },
    };
})